package go.tetris.client;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * NewGameDialog
 */
public final class NewGameDialog extends DialogBox implements ClickListener {
	public NewGameDialog() {

		this.setHTML("Тетрис");
		this.setAnimationEnabled(true);
		HTML html = new HTML("<u>Удирдах</u><br/>"
				+ "<b>Баруун, зүүн, доошоо сум</b>: удирдна<br/>"
				+ "<b>Дээшээ сумаар</b>: дүрсээ эргүүлнэ. <br/>");
		Button button = new Button("Шинээр тоглох");
		VerticalPanel dialogVPanel = new VerticalPanel();
		dialogVPanel.setWidth("100%");
		dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
		dialogVPanel.add(html);
		dialogVPanel.add(button);

		button.addClickListener(this);

		
		this.setWidget(dialogVPanel);
		this.center();
	}

	public void onClick(Widget sender) {
		this.hide();
		Tetris.newGame();
	}
}
